package com.heima.article.controller.v1;


import com.heima.article.service.IApArticleService;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 文章信息表，存储已发布的文章 前端控制器
 * </p>
 *
 * @author sunhui
 * @since 2024-03-28
 */
@RestController
@RequestMapping(path = "/api/v1/article")
@Slf4j
@Api(tags = "APP端文章展示")
public class ApArticleController {

    @Autowired
    private IApArticleService apArticleService;

    @PostMapping("/load")
    public ResponseResult load(@RequestBody ArticleHomeDto dto) { //通用的结果返回类
        return apArticleService.load(dto); //加载首页
    }

}
